<?php

use App\Admin\Controllers\ArticleController;
use App\Admin\Controllers\CategoryController;
use App\Admin\Controllers\ConfigController;
use App\Admin\Controllers\CustomerServiceController;
use App\Admin\Controllers\DownloadController;
use App\Admin\Controllers\FeedbackController;
use App\Admin\Controllers\HomeController;
use App\Admin\Controllers\MaterialController;
use App\Admin\Controllers\MessageController;
use App\Admin\Controllers\OrderController;
use App\Admin\Controllers\ProjectController;
use App\Admin\Controllers\UserController;
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use Dcat\Admin\Admin;

Admin::routes();

Route::group([
    'prefix' => config('admin.route.prefix'),
    'middleware' => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('dashboard', [HomeController::class, 'index'])->name('home');
    //意见反馈
    $router->resource('feedback', FeedbackController::class);
    //用户
    $router->resource('user', UserController::class);
    //客服
    $router->resource('customer-service', CustomerServiceController::class);

    //文章
    $router->resource('article', ArticleController::class);

    //分类
    $router->resource('category', CategoryController::class);
    //项目
    $router->resource('project', ProjectController::class);
    //资料
    $router->resource('material', MaterialController::class);
    //购买记录
    $router->resource('order', OrderController::class);
    //下载记录
    $router->resource('download', DownloadController::class);
    //用户消息
    $router->resource('message', MessageController::class);

    //网站配置
    $router->get('config', [ConfigController::class, 'index']);
});
